﻿using Domain.Entity;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFCore.Configers
{
    public class EMRConfigers : IEntityTypeConfiguration<EMR>
    {
        public void Configure(EntityTypeBuilder<EMR> builder)
        {
            builder.ToTable(nameof(EMR));
            builder.Property(x => x.FirstKindId).IsRequired(false).HasMaxLength(2);
            builder.Property(x => x.FirstKindName).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.SecondKindId).IsRequired(false).HasMaxLength(2);
            builder.Property(x => x.SecondKindName).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.ThirdKindId).IsRequired(false).HasMaxLength(2);
            builder.Property(x => x.ThirdKindName).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.MajorId).IsRequired(false).HasMaxLength(2);
            builder.Property(x => x.MajorName).IsRequired(false).HasMaxLength(60);

            builder.Property(x => x.HumanAmount).IsRequired(false);
            builder.Property(x => x.EngageType).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.Deadline).IsRequired(false);
            builder.Property(x => x.Register).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.Changer).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.RegistTime).IsRequired(false);
            builder.Property(x => x.ChangeTime).IsRequired(false);
            builder.Property(x => x.MajorDescribe).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.EngageRequired).IsRequired(false).HasMaxLength(60);
        }
    }
}
